package model.promo;
// Generated Feb 5, 2013 11:50:02 PM by Hibernate Tools 3.2.1.GA


import java.math.BigDecimal;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import model.inventory.Item;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * MstPricePrimo generated by hbm2java
 */
@Entity
@Table(name="mst_promo_price", schema="promo")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class PromoPrice  implements java.io.Serializable {

    private PromoPriceId id;
    private Promo promo;
    private Item item;
    private BigDecimal price;
    private BigDecimal margin;
    private BigDecimal markup;
    private BigDecimal salesPrice;
    private BigDecimal costPrice;
    private Boolean updated=false;
    
    public PromoPrice() {
        this.item = new Item();
        this.promo = new Promo();
        
        this.price = BigDecimal.ZERO;
        this.margin = BigDecimal.ZERO;
        this.markup = BigDecimal.ZERO;
        this.salesPrice = BigDecimal.ZERO;
        this.costPrice = BigDecimal.ZERO;
    }
	
    public PromoPrice(PromoPriceId id, Promo promo) {
        this.id = id;
        this.promo = promo;
    }
       
    @EmbeddedId
    @AttributeOverrides( {
        @AttributeOverride(name="id", column=@Column(name="id", nullable=false) ), 
        @AttributeOverride(name="item_id", column=@Column(name="item_id", nullable=false) ) } )
    public PromoPriceId getId() {
        return this.id;
    }
    
    public void setId(PromoPriceId id) {
        this.id = id;
    }
    
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id", nullable=false, insertable=false, updatable=false)
    public Promo getPromo() {
        return this.promo;
    }
    
    public void setPromo(Promo promo) {
        this.promo = promo;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="item_id", nullable=false, insertable=false, updatable=false)
    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }
        
    @Column(name="price", precision=12)
    public BigDecimal getPrice() {
        return this.price;
    }
    
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    
    @Column(name="margin", precision=12, scale=3)
    public BigDecimal getMargin() {
        return this.margin;
    }
    
    public void setMargin(BigDecimal margin) {
        this.margin = margin;
    }
    
    @Column(name="markup", precision=12)
    public BigDecimal getMarkup() {
        return this.markup;
    }
    
    public void setMarkup(BigDecimal markup) {
        this.markup = markup;
    }

    @Column(name="sales_price", precision=12)
    public BigDecimal getSalesPrice() {
        return salesPrice;
    }

    public void setSalesPrice(BigDecimal salesPrice) {
        this.salesPrice = salesPrice;
    }

    @Column(name="cost_price", precision=12)
    public BigDecimal getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(BigDecimal costPrice) {
        this.costPrice = costPrice;
    }

    @Transient
    public Boolean getUpdated() {
        return updated;
    }

    public void setUpdated(Boolean updated) {
        this.updated = updated;
    }
    
    

    



}


